<?php
$this->breadcrumbs=array();

$this->sidebarTop = array(
    'label' => Yii::t('BackEnd', "System"),
    'link' => "#"
);

$this->moduleName = "AdminUser";

//Declare icons
$iconCreate = '<img src="'.Yii::app()->request->baseUrl.'/css/admin/images/icons/create_12x12.png" class="icon" />&nbsp;';
$iconManager = '<img src="'.Yii::app()->request->baseUrl.'/css/admin/images/icons/4_14x14.png" class="icon" />&nbsp;';
$iconList = '<img src="'.Yii::app()->request->baseUrl.'/css/admin/images/icons/2_15x15.png" class="icon" />&nbsp;';

$this->menu=array(
	array('label'=>$iconCreate.Yii::t('BackEnd', 'Create'), 'url'=>array('create'), 'visible'=>UserAccess::checkAccess('AdminUserCreate')),
	array('label'=>$iconManager.Yii::t('BackEnd', 'Manage'), 'url'=>array('admin'), 'visible'=>UserAccess::checkAccess('AdminUserAdmin')),
);

$this->slidebar = Backend::getModuleSlideBar('Setting', '/adminUser/index');

//Declare view title
$this->title = $iconList.Yii::t('BackEnd', 'List accounts');
?>

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'admin-user-grid',
	'dataProvider'=>$dataProvider,
	'columns'=>array(
		'id',
		array(
            'name' => 'username',
            'htmlOptions' => array('style'=>'text-align: left;'),
        ),
		array(
            'name' => 'email',
            'htmlOptions' => array('style'=>'text-align: left;'),
        ),
		'first_name',
		'last_name',
        array(
            'name' => 'status',
            'value' => 'AdminUser::model()->getStatusLabel($data->status)',
        ),
		array(
			'class'=>'CButtonColumn',
            'header'=> Yii::t('BackEnd', 'Actions'),
            'viewButtonImageUrl'=> Yii::app()->request->baseUrl.'/css/admin/images/page-view.png',
            'updateButtonImageUrl'=> Yii::app()->request->baseUrl.'/css/admin/images/page-edit.png',
            'deleteButtonImageUrl'=> Yii::app()->request->baseUrl.'/css/admin/images/page-delete.png'
		),
	),
)); ?>
